/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package insulinpumpsimulation.com.his.tasks;

import java.util.Random;

/**
 *
 * @author Arun
 */
public class RandomGenerator {
    
    static int aStart = 60;
    static int aEnd = 140;
    static Random aRandom = new Random();
    static int graphSet= 1;
    public static int showRandomInteger(){
        
    if ( aStart > aEnd ) {
      throw new IllegalArgumentException("Start cannot exceed End.");
    }
    //get the range, casting to long to avoid overflow problems
    long range = (long)aEnd - (long)aStart + 1;
    // compute a fraction of the range, 0 <= frac < range
    long fraction = (long)(range * aRandom.nextDouble());
    int randomNumber =  (int)(fraction + aStart); 
    if (graphSet == 1)
    {
        randomNumber = 120;
        graphSet++;
    }
    return randomNumber;
  }
    
}
